home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Stuff / 3D_Reality / 3D_Reality_API / Examples / PatchMesh.bproj / GetUVValue.m < prev    next >
Encoding:
Text File  |  1992-09-01  |  1003 b   |  63 lines

  1. #import "../Stone3DAPI/Stone3D.h"
  2. #import "GetUVValue.h"
  3.  
  4. @implementation GetUVValue
  5.  
  6. - loadNib
  7. {
  8.     id bfc=[NXBundle bundleForClass:[self class]];
  9.     char path[MAXPATHLEN+1];
  10.     
  11.     [bfc getPath:path forResource:[self name] ofType:"nib"];
  12.     
  13.     [NXApp loadNibFile:path owner:self
  14.         withNames:NO fromZone:[self zone]];
  15.         
  16.     return self;
  17. }
  18.  
  19.  
  20. static id one = nil;
  21. + instance 
  22. {
  23.     if (!one)  {
  24.     one = self = [super new];
  25.     [self loadNib];
  26.     } else self = one;
  27.     return self;
  28. }
  29.  
  30. - (BOOL)runModalForControl:(int *)u :(int *)v
  31. {
  32.     BOOL retVal = YES;
  33.     
  34.     [uField setIntValue:*u];
  35.     [vField setIntValue:*v];
  36.     [pointMatrix selectCell:uField];
  37.     if ([NXApp runModalFor:window]==NX_RUNSTOPPED) {
  38.     *u = [uField intValue];
  39.     *v = [vField intValue];
  40.     }
  41.     [window orderOut:self];
  42.     if (!oked) retVal = NO;
  43.     return retVal;
  44. }
  45.  
  46.  
  47. - revert:sender
  48. {
  49.     oked = NO;
  50.     [NXApp abortModal];
  51.     return nil;
  52. }
  53.  
  54.  
  55. - ok:sender
  56. {
  57.     oked = YES;
  58.     [NXApp stopModal];
  59.     return self;
  60. }
  61.  
  62. @end
  63.